package com.dbb.trade.entity.product;

import javax.persistence.Embeddable;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.Parent;

@Embeddable
public class ColorSize{
	private String color;
	private String size;
	private Integer num;
	private Suit suit;
	
	public ColorSize() { }
	
	public ColorSize(String color, String size, Integer num) {
		this.color = color;
		this.size = size;
		this.num = num;
	}
	
	public ColorSize(Color c, Size s) {
		this.color = c.getName();
		this.size = s.getName();
	}

	@Parent
	public Suit getSuit() {
		return suit;
	}

	public void setSuit(Suit suit) {
		this.suit = suit;
	}
	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public Integer getNum() {
		return num == null ? 0 : num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	
	public String toString() {
		return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}
	
}
